import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue'),
    redirect:'index',
    children:[
      {
        path: 'index',
        name: 'index',
        component: () => import(/* webpackChunkName: "about" */ '../views/index.vue')
      },
      {
        path: '/question',
        name: 'Question',
        component: () => import(/* webpackChunkName: "about" */ '../views/question/Question.vue')
      },
      {
        path: '/questionDetail/:id',
        name: 'QuestionDetail',
        component: () => import(/* webpackChunkName: "about" */ '../views/question/QuestionDetail.vue')
      },
      {
        path: '/articleDetail/:id',
        name: 'ArticleDetail',
        component: () => import(/* webpackChunkName: "about" */ '../views/article/ArticleDetail.vue')
      },
      {
        path: '/article',
        name: 'Article',
        component: () => import(/* webpackChunkName: "about" */ '../views/article/Article.vue')
      },
      {
        path: '/archive',
        name: 'Archive',
        component: () => import(/* webpackChunkName: "about" */ '../views/archive/Archive.vue')
      },
      {
        path: '/resources',
        name: 'Resources',
        component: () => import(/* webpackChunkName: "about" */ '../views/resources/Resources.vue')
      },
      {
        path: '/direction',
        name: 'Direction',
        component: () => import(/* webpackChunkName: "about" */ '../views/direction/Direction.vue')
      },
      {
        path: '/about',
        name: '/About',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/About.vue')
      },
      {
        path: 'person',
        name: '个人信息',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/Person.vue')
      },
      {
        path: 'updatePassword',
        name: '修改密码',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/UpdatePassword.vue')
      },
      {
        path: 'myComment',
        name: '我的评论',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/MyComment.vue')
      },
      {
        path: 'myLike',
        name: '我的评论',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/MyLike.vue')
      },
      {
        path: 'myCollect',
        name: '我的评论',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/MyCollect.vue')
      },
    ]
  },


]



const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})



export default router
